package com.summer_administration.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class Member {
    private Integer id;

    @NotBlank(message = "成员姓名不能为空")
    @Size(max = 10, message = "成员姓名最长10个字符")
    private String memberName;

    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "男|女", message = "性别必须为男或女")
    private String gender;

    @NotBlank(message = "联系方式不能为空")
    @Size(max = 36, message = "联系方式最长36位")
    private String number;

    @NotBlank(message = "保险状态不能为空")
    @Pattern(regexp = "是|否", message = "保险状态必须为是或否")
    private String ifInsure;

    @JsonIgnore
    private Integer createUser;

    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}